package dao;

import domain.ShowComment;
import domain.VirtualComment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CommentDao {
    @Select("select user.uname,comment.comment_date_time,comment.context from comment,user where fid = #{id} and user.uid = comment.uid")
    List<ShowComment> getById(int id);

    @Insert("insert into comment values(null,#{uid},#{fid},#{comment_date_time},#{context})")
    void addComment(VirtualComment virtualComment);
}
